#pragma once
#include <linux/firmware.h>





int r5u870_control_msg( struct driverInstance* this, int write, int class, u8 request, u16 value, u16 index, void* data, u16 size );





int r5u870_cap_stop_uvc( struct driverInstance* );
int r5u870_decide_pkt_uvc( struct driverInstance*, int pktstatus, int pktlen, const u8* pktdata, int* start );
int r5u870_uvc_parse_vc( struct driverInstance* );
int webcamApplyFormat_uvc( struct driverInstance* );




struct claimed_interface {
	struct list_head            listItem;   //ui_links;
	struct usb_interface*       interface;  //ui_intf;
};

/****************************
*         CONTROLS          *
****************************/

static const char* powerline_frequency_menu_item_names[] = { "Off", "50 Hz", "60 Hz", "" };


struct webcam_control {
	struct v4l2_ctrl_config control;//uc_v4l
	int                     reg;
	
	//uvc only
	u8 unit;
	u8 info;
	u8 size;
};

/****************************
*           ENUM            *
****************************/


/*
 * WDM Device Registers are listed below.
 *
 * To set: use r5u870_set_reg_wdm().
 *
 * No information is given about how to retrieve values from these
 * registers.
 *
 * Note that some register IDs are overloaded.  The Sony cam drivers
 * seem to use 0x36 for backlight compensation and 0x37 for gain,
 * whereas the HP drivers use 0x36 for color enable and 0x37 for frame
 * rate.
 */
enum {
	R5U870_REG_BRIGHTNESS =         0x02, // Brightness: [0,127] D:63 
	R5U870_REG_CONTRAST =           0x04, // Contrast: [0,127] D:63
	R5U870_REG_HUE =                0x34, // Hue: [-180,180] D:0 (16-bit 2's complement)
	R5U870_REG_SATURATION =         0x05, // Saturation: [0,127] D:63
	R5U870_REG_SHARPNESS =          0x03, // Sharpness: [0,127] D:63
	R5U870_REG_GAMMA =              0x35, // Gamma correction: [1,500] D:100
	R5U870_REG_COLOR_ENABLE =       0x36, // Registers with unknown usage
	R5U870_REG_WHITE_BALANCE =      0x1,  // White balance: [0,127] D:63
	R5U870_REG_FRAME_RATE =         0x37, // Frame Rate: D:30

	/* Registers with unknown usage */
	R5U870_REG_BRIGHTNESS_EX = 0x20,
	R5U870_REG_CONTRAST_EX = 0x21,
	R5U870_REG_HUE_EX = 0x22,
	R5U870_REG_SATURATION_EX = 0x23,
	R5U870_REG_SHARPNESS_EX = 0x24,
	R5U870_REG_GAMMA_EX = 0x25,
	
	R5U870_REG_WB_RED_EX =          0x26, // White balance red value: [0,255] D:127
	R5U870_REG_WB_GREEN_EX =        0x27, // White balance green value: [0,255] D:127
	R5U870_REG_WB_BLUE_EX =         0x28, // White balance blue value: [0,255] D:127
	R5U870_REG_WB_AUTO_EX =         0x29, // Auto white balance: [0,1] D:1
	R5U870_REG_EXPOSURE_EX =        0x2a, // Exposure Control: [0,255] D:255
	R5U870_REG_AEC_EX =             0x2b, // Auto Exposure Control: [0,1] D:1
	R5U870_REG_GAIN_EX =            0x2c, // Gain: [0,127] D:63
	R5U870_REG_AGC_EX =             0x2d, // Auto Gain: [0,1] D:0
	R5U870_REG_POWERLINE_EX =       0x2e, // Light source flicker compensation: see R5U870_POWERLINE
	R5U870_REG_SCENE_EX =           0x2f, // Registers with unknown usage
	R5U870_REG_VFLIP_EX =           0x30, // Vertical flip: [0,1] D:0
	R5U870_REG_HFLIP_EX =           0x31, // Horizontal flip: [0,1] D:0
	R5U870_REG_PRIVACY_EX =         0x32, // Blank image: [0,1] D:0
	R5U870_REG_NIGHT_MODE_EX =      0x33, // Night mode: [0,1] D:0
	R5U870_REG_BACKLIGHT_COMP =     0x36, // Backlight compensation: [0,500] D:1
	R5U870_REG_GAIN =               0x37, // Registers with unknown usage
	R5U870_REG_BACKLIGHT_COMP_2 =   0x39, // Backlight compensation for 1834 device: [0,2] D:1
	
	/* Values for R5U870_REG_POWERLINE flicker compensation */
	R5U870_POWERLINE_OFF = 0,
	R5U870_POWERLINE_50HZ = 1,
	R5U870_POWERLINE_60HZ = 2,
	
	R5U870_EMPTYPKT_FRAME_DELIM =   10,   // Number of empty packets between frames
	R5U870_EMPTYPKT_GIVE_UP =       4000, //Number of empty packets before declaring the device dead (.5sec)
};


enum {
	R5U870_WDM_CTRL_BRIGHTNESS,
	R5U870_WDM_CTRL_CONTRAST,
	R5U870_WDM_CTRL_SATURATION,
	R5U870_WDM_CTRL_SHARPNESS,
	R5U870_WDM_CTRL_HUE,
	R5U870_WDM_CTRL_GAMMA,
	R5U870_WDM_CTRL_BACKLIGHT_COMP_500,
	R5U870_WDM_CTRL_BACKLIGHT_COMP_500_DEF1,
	R5U870_WDM_CTRL_BACKLIGHT_COMP_X1834,
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_GREEN,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_AUTO_EXPOSURE,
	R5U870_WDM_CTRL_EXPOSURE,
	R5U870_WDM_CTRL_AUTO_GAIN,
	R5U870_WDM_CTRL_GAIN,
	R5U870_WDM_CTRL_POWERLINE,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_VFLIP_DEFAULTON,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_NIGHTMODE,

	R5U870_WDM_CTRL_LAST = 0xffff,
};


//this defines is not exist in the kernel
//R5U870_WDM_CTRL_AUTO_EXPOSURE,//V4L2_CID_EXPOSURE_AUTO
//R5U870_WDM_CTRL_WB_GREEN,//V4L2_CID_GREEN_BALANCE


/****************************
*     MODEL CONTROLS DB     *
****************************/

static const int r5u870_1830_ctrls[] = {
	R5U870_WDM_CTRL_BRIGHTNESS,
	R5U870_WDM_CTRL_CONTRAST,
	R5U870_WDM_CTRL_SATURATION,
	R5U870_WDM_CTRL_SHARPNESS,
	R5U870_WDM_CTRL_HUE,
	R5U870_WDM_CTRL_GAMMA,
	R5U870_WDM_CTRL_BACKLIGHT_COMP_500,
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_GREEN,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_GAIN,
	R5U870_WDM_CTRL_POWERLINE,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_NIGHTMODE,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1832_ctrls[] = {
	R5U870_WDM_CTRL_BRIGHTNESS,
	R5U870_WDM_CTRL_CONTRAST,
	R5U870_WDM_CTRL_HUE,
	R5U870_WDM_CTRL_SATURATION,
	R5U870_WDM_CTRL_BACKLIGHT_COMP_500_DEF1,
	R5U870_WDM_CTRL_POWERLINE,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_NIGHTMODE,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1833_ctrls[] = {
	R5U870_WDM_CTRL_BRIGHTNESS,
	R5U870_WDM_CTRL_CONTRAST,
	R5U870_WDM_CTRL_HUE,
	R5U870_WDM_CTRL_SATURATION,
	R5U870_WDM_CTRL_SHARPNESS,
	R5U870_WDM_CTRL_GAMMA,
	R5U870_WDM_CTRL_BACKLIGHT_COMP_500_DEF1,
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_GREEN,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_POWERLINE,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_NIGHTMODE,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1834_ctrls[] = {
	R5U870_WDM_CTRL_BRIGHTNESS,
	R5U870_WDM_CTRL_CONTRAST,
	R5U870_WDM_CTRL_HUE,
	R5U870_WDM_CTRL_SATURATION,
	R5U870_WDM_CTRL_SHARPNESS,
	R5U870_WDM_CTRL_GAMMA,
	R5U870_WDM_CTRL_BACKLIGHT_COMP_X1834,
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_AUTO_EXPOSURE,
	R5U870_WDM_CTRL_EXPOSURE,
	R5U870_WDM_CTRL_AUTO_GAIN,
	R5U870_WDM_CTRL_GAIN,
	R5U870_WDM_CTRL_POWERLINE,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_NIGHTMODE,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1870_ctrls[] = {
	R5U870_WDM_CTRL_BRIGHTNESS,
	R5U870_WDM_CTRL_CONTRAST,
	R5U870_WDM_CTRL_HUE,
	R5U870_WDM_CTRL_SATURATION,
	R5U870_WDM_CTRL_SHARPNESS,
	R5U870_WDM_CTRL_GAMMA,
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_AUTO_EXPOSURE,
	R5U870_WDM_CTRL_EXPOSURE,
	R5U870_WDM_CTRL_AUTO_GAIN,
	R5U870_WDM_CTRL_GAIN,
	R5U870_WDM_CTRL_POWERLINE,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_NIGHTMODE,
	R5U870_WDM_CTRL_LAST,
};

/*
 * Even the UVC models do not express all of their controls in the UVC
 * descriptor tables, and get sets of hard-coded vendor controls
 */

// FIXME: This device still has a bunch of unknown control IDs.
static const int r5u870_1812_ctrls[] = {
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_GREEN,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1835_ctrls[] = {
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_GREEN,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1810_1836_ctrls[] = {
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_AUTO_EXPOSURE,
	R5U870_WDM_CTRL_EXPOSURE,
	R5U870_WDM_CTRL_AUTO_GAIN,
	R5U870_WDM_CTRL_GAIN,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_NIGHTMODE,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1810_1837_ctrls[] = {
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_AUTO_EXPOSURE,
	R5U870_WDM_CTRL_EXPOSURE,
	R5U870_WDM_CTRL_AUTO_GAIN,
	R5U870_WDM_CTRL_GAIN,
	R5U870_WDM_CTRL_VFLIP_DEFAULTON,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_NIGHTMODE,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1810_183a_ctrls[] = {
 	R5U870_WDM_CTRL_WB_RED, 
 	R5U870_WDM_CTRL_WB_GREEN,
 	R5U870_WDM_CTRL_WB_BLUE, 
 	R5U870_WDM_CTRL_WB_AUTO, 
 	R5U870_WDM_CTRL_VFLIP, 
 	R5U870_WDM_CTRL_HFLIP, 
 	R5U870_WDM_CTRL_PRIVACY,
 	R5U870_WDM_CTRL_NIGHTMODE, 
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1810_183b_ctrls[] = {
	/* TODO: Maybe there are more of these? I don't actually have a webcam
	   to test against the different WDM controls. */
 	R5U870_WDM_CTRL_WB_RED, 
 	R5U870_WDM_CTRL_WB_GREEN,
 	R5U870_WDM_CTRL_WB_BLUE, 
 	R5U870_WDM_CTRL_WB_AUTO, 
 	R5U870_WDM_CTRL_VFLIP, 
 	R5U870_WDM_CTRL_HFLIP, 
 	R5U870_WDM_CTRL_PRIVACY,
 	R5U870_WDM_CTRL_NIGHTMODE, 
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1810_183e_ctrls[] = {
	/* TODO: Maybe there are more of these? I don't actually have a webcam
	   to test against the different WDM controls. */
 	R5U870_WDM_CTRL_WB_RED,
 	R5U870_WDM_CTRL_WB_GREEN,
 	R5U870_WDM_CTRL_WB_BLUE,
 	R5U870_WDM_CTRL_WB_AUTO,
 	R5U870_WDM_CTRL_VFLIP,
 	R5U870_WDM_CTRL_HFLIP,
 	R5U870_WDM_CTRL_PRIVACY,
 	R5U870_WDM_CTRL_NIGHTMODE,
	R5U870_WDM_CTRL_LAST,
};
static const int r5u870_1810_1839_ctrls[] = {
	/* TODO: Maybe there are more of these? I don't actually have a webcam
   	   to test against the different WDM controls. */
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_GREEN,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_LAST,
};

static const int r5u870_1841_ctrls[] = {
	/* TODO: Maybe there are more of these? I don't actually have a webcam
	   to test against the different WDM controls. */
	R5U870_WDM_CTRL_WB_RED,
	R5U870_WDM_CTRL_WB_GREEN,
	R5U870_WDM_CTRL_WB_BLUE,
	R5U870_WDM_CTRL_WB_AUTO,
	R5U870_WDM_CTRL_VFLIP,
	R5U870_WDM_CTRL_HFLIP,
	R5U870_WDM_CTRL_PRIVACY,
	R5U870_WDM_CTRL_LAST,
};


/****************************
*       RESOLUTIONS DB      *
****************************/

/*
 * Standard resolution table for non-UVC cameras,
 * as UVC camera report back as to what resolutions
 * they support.
 * The Sony VGP-VCC2 Windows driver supports:
 *	160x120, 176x144, 320x240, 352x288, 640x480
 * The HP driver also supports 1280x1024
 */
static const struct r5u870_resolution r5u870_vga_wdm_res[] = {
	{  160,  120,  1152000 },//30 fps
	{  176,  144,  1520640 },//30 fps
	{  320,  240,  4608000 },//30 fps
	{  352,  288,  6082560 },//30 fps
	{  640,  480, 18432000 },//30 fps
	{ }
};
static const struct r5u870_resolution r5u870_sxga_wdm_res[] = {
	{  160,  120,  1152000 },//30 fps
	{  176,  144,  1520640 },//30 fps
	{  320,  240,  4608000 },//30 fps
	{  352,  288,  6082560 },//30 fps
	{  640,  480, 18432000 },//30 fps
	{ 1280, 1024, 19660800 },//7.5 fps
	{ }
};
static struct r5u870_pixelformat r5u870_vga_wdm_pixfmts[] = {
	{ 
		.description = "YUY2 4:2:2", 
		.pixelformat = V4L2_PIX_FMT_YUYV,
		.flags = 0, 
		.formatId = 0,
		.resolutionTable = r5u870_vga_wdm_res 
	},

	{
		.description = "UYVY 4:2:2",
		.pixelformat = V4L2_PIX_FMT_UYVY,
		.flags = 0,
		.formatId = 1,
		.resolutionTable = r5u870_vga_wdm_res 
	},
};
static struct r5u870_pixelformat r5u870_sxga_wdm_pixfmts[] = {
	{
		.description = "YUY2 4:2:2",
		.pixelformat = V4L2_PIX_FMT_YUYV,
		.flags = 0,
		.formatId = 0,
		.resolutionTable = r5u870_sxga_wdm_res 
	},

	{ 
		.description = "UYVY 4:2:2",
		.pixelformat = V4L2_PIX_FMT_UYVY,
		.flags = 0,
		.formatId = 1,
		.resolutionTable = r5u870_sxga_wdm_res 
	},
};


/****************************
*         MODELS DB         *
****************************/

static const struct r5u870_model r5u870_models[] = {
	[R5U870_DI_VGP_VCC2_SZ] = {
		.modelName = "Sony VGP-VCC2 (VAIO SZ)",
		.ucodeFile = "r5u870_1830.fw",
		.ucodeVersion = 0x0100,
		.controls_wdm = r5u870_1830_ctrls,
		.pixelformats = r5u870_vga_wdm_pixfmts,
		.pixelformatsCount = ARRAY_SIZE(r5u870_vga_wdm_pixfmts),
	},
	[R5U870_DI_VGP_VCC3] = {
		.modelName = "Sony VGP-VCC3",
		.ucodeFile = "r5u870_1832.fw",
		.ucodeVersion = 0x0100,
		.controls_wdm = r5u870_1832_ctrls,
		.pixelformats = r5u870_vga_wdm_pixfmts,
		.pixelformatsCount = ARRAY_SIZE(r5u870_vga_wdm_pixfmts),
		.rm_no_ctrl_reload = 1,
	},
	[R5U870_DI_VGP_VCC2_AR1] = {
		.modelName = "Sony VGP-VCC2 (VAIO AR1)",
		.ucodeFile = "r5u870_1833.fw",
		.ucodeVersion = 0x0100,
		.controls_wdm = r5u870_1833_ctrls,
		.pixelformats = r5u870_vga_wdm_pixfmts,
		.pixelformatsCount = ARRAY_SIZE(r5u870_vga_wdm_pixfmts),
	},
	[R5U870_DI_VGP_VCC2_AR2] = {
		.modelName = "Sony VGP-VCC2 (VAIO AR)",
		.ucodeFile = "r5u870_1834.fw",
		.ucodeVersion = 0x0111,
		.controls_wdm = r5u870_1834_ctrls,
		.pixelformats = r5u870_vga_wdm_pixfmts,
		.pixelformatsCount = ARRAY_SIZE(r5u870_vga_wdm_pixfmts),
	},
	[R5U870_DI_VGP_VCC5] = {
		.modelName = "Sony VGP-VCC5",
		.ucodeFile = "r5u870_1835.fw",
		.ucodeVersion = 0x0107,
		.controls_wdm = r5u870_1835_ctrls,
		.isUvc = 1,
	},
	[R5U870_DI_VGP_VCC4] = {
		.modelName = "Sony VGP-VCC4",
		.ucodeFile = "r5u870_1836.fw",
		.ucodeVersion = 0x0115,
		.controls_wdm = r5u870_1810_1836_ctrls,
		.isUvc = 1,
	},
	[R5U870_DI_VGP_VCC4_VFLIP] = {
		.modelName = "Sony VGP-VCC4",
		.ucodeFile = "r5u870_1836.fw",
		.ucodeVersion = 0x0115,
		.controls_wdm = r5u870_1810_1837_ctrls,
		.isUvc = 1,
	},
	[R5U870_DI_VGP_VCC6] = {
		.modelName = "Sony VGP-VCC6",
		.ucodeFile = "r5u870_1839.fw",
		//Which one is correct?
		//.ucodeVersion = 0x0113,
		.ucodeVersion = 0x0030,
		.controls_wdm = r5u870_1810_1839_ctrls,
		.isUvc = 1,
	},
	[R5U870_DI_VGP_VCC7] = {
		.modelName = "Sony VGP-VCC7",
		.ucodeFile = "r5u870_183a.fw",
		.ucodeVersion = 0x0111,
		.controls_wdm = r5u870_1810_183a_ctrls,
		.isUvc = 1,
	},
	[R5U870_DI_VGP_VCC8] = {
		.modelName = "Sony VGP-VCC8",
		.ucodeFile = "r5u870_183b.fw",
		.ucodeVersion = 0x0131,
		.controls_wdm = r5u870_1810_183b_ctrls,
		.isUvc = 1,
	},
	[R5U870_DI_VGP_VCC9] = {
		.modelName = "Sony VGP-VCC9",
		.ucodeFile = "r5u870_183e.fw",
		.ucodeVersion = 0x0100,
		.controls_wdm = r5u870_1810_183e_ctrls,
		.isUvc = 1,
	},
	[R5U870_DI_FUJITSU] = {
		.modelName = "Fujitsu F01",
		.ucodeFile = "r5u870_1841.fw",
		.ucodeVersion = 0x0103,
		.controls_wdm = r5u870_1841_ctrls,
		.isUvc = 1,
	},
	[R5U870_DI_HP_WEBCAM1K] = {
		.modelName = "HP Webcam 1000",
		.ucodeFile = "r5u870_1870_1.fw",
		.ucodeVersion = 0x0100,
		.controls_wdm = r5u870_1870_ctrls,
		.pixelformats = r5u870_vga_wdm_pixfmts,
		.pixelformatsCount = ARRAY_SIZE(r5u870_vga_wdm_pixfmts),
	},
	[R5U870_DI_HP_PAVWC_WDM] = {
		.modelName = "HP Pavilion Webcam (WDM)",
		.ucodeFile = "r5u870_1870.fw",
		.ucodeVersion = 0x0112,
		.controls_wdm = r5u870_1870_ctrls,
		.pixelformats = r5u870_sxga_wdm_pixfmts,
		.pixelformatsCount = ARRAY_SIZE(r5u870_sxga_wdm_pixfmts),
		.rm_no_ctrl_reload = 1,
	},
	[R5U870_DI_HP_PAVWC_UVC] = {
		.modelName = "HP Pavilion Webcam (UVC)",
		.ucodeFile = "r5u870_1810.fw",
		.ucodeVersion = 0x0115,
		.controls_wdm = r5u870_1810_1836_ctrls,
		.isUvc = 1,
		.rm_no_ctrl_reload = 1,
	},
	[R5U870_DI_HP_PAVWC_UVC_NOFW] = {
		.modelName = "HP Pavilion Webcam (UVC - NO FW)",
		.controls_wdm = r5u870_1812_ctrls,
		.isUvc = 1,
		.rm_no_ctrl_reload = 1,
	},
	[R5U870_DI_GENERIC_UVC] = {
		.modelName = "Generic UVC Webcam",
		.isUvc = 1,
	},
};







































































